package com.yuyu.shop.infrastructure.persistence.convert;

import cn.hutool.core.bean.BeanUtil;
import com.yuyu.shop.domain.order.DO.OrderDO;
import com.yuyu.shop.infrastructure.persistence.po.SecKillOrderPO;

import java.util.Objects;

/**
 * @author
 * @version 1.0
 * @description: TODO
 * @date 2022/9/23 17:00
 */
public class SecKillOrderPOConvert {

    public static OrderDO PO2DO(SecKillOrderPO po){
        if (Objects.nonNull(po)){
            OrderDO orderDO = new OrderDO();
            BeanUtil.copyProperties(po,orderDO);
            return orderDO;
        }
        return null;
    }

    public static SecKillOrderPO DO2PO(OrderDO orderDO){
        if (Objects.nonNull(orderDO)){
            SecKillOrderPO orderPO = new SecKillOrderPO();
            BeanUtil.copyProperties(orderDO,orderPO);
            return orderPO;
        }
        return null;
    }
}
